-
-
Notifications
You must be signed in to change notification settings - Fork 155
Updated ToDo List exercise to promote modularization using ES Modules #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks great! My big question is: Should the "What is ESM" and "How to use ESM" live in the curriculum proper (in the prep for the sprint) rather than in the exercise repo?
- Separation of Concerns – Each part of the code handles a specific task, keeping things clear and organized. | ||
- Team Collaboration – Multiple people can work on different modules at the same time without conflict. | ||
- Scalability – You can add new features more easily as the project grows. | ||
- Testing – Smaller modules are easier to test individually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels maybe worth giving an "all together" vs "split out" example alongside this content? I think "separation of concerns" and "testability" are quite hard things to visualise without an example if you haven't experienced them before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some examples to illustrate those ideas could be useful. I can prepare them.
- Scalability – You can add new features more easily as the project grows. | ||
- Testing – Smaller modules are easier to test individually. | ||
- Readability – Modular code is easier to read, understand, and navigate. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth mentioning explicitly that when you import
something it causes all of the top-level statements in that file to get run? Which is why defining functions is fine, but e.g. adding an event listener isn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention is to introduce the bare minimum of ESM through an example to get them started, and expect them to find out more about ESM from external resources:
- https://javascript.info/modules-intro
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
Too much info initially could overwhelm many of them.
Co-authored-by: Daniel Wagner-Hall <[email protected]>
Co-authored-by: Daniel Wagner-Hall <[email protected]>
I was aiming to only introduce ESM through an example, and not requiring the trainees to use ESM in all their DOM-related exercises. (Do we want to?)
|
Yeah, I think this makes sense - thanks! |
Changelist
Updated the todo-list exercise to demonstrate how we can modularize a web app using ES Modules.